
#if 0
#include <string.h>
#include "WCI.h"
#include "ISO14443Command.h"
#include "ISO14443p4b.h"


#define FWT_Diff	384
#define FWT_Calc(fwi) ((256 * 16 + FWT_Diff) << (fwi))

static unsigned int Param_B_GetFWT(const unsigned char info[]) {
	unsigned char ch = info[2];
	unsigned char FWI = ch >> 4;
	if (FWI > 14) {
		FWI = 4;
	}
	return FWT_Calc(FWI);
}

static unsigned int Param_B_GetFGT(const unsigned char info[]) {
	const unsigned int TR2_Table[] = {
		32, 128, 256, 512
	};
	unsigned char c = info[1];
	unsigned char tr2 = (c >> 1) & 3;

	return TR2_Table[tr2] * 16 + 384;
}

static unsigned int Param_B_GetSFGT(const unsigned char info[]) {
	return 256 * 16 + 384;
}

static unsigned int Param_B_GetFSC(const unsigned char info[]) {
	const unsigned int maxFrameSize[9] = {
		16,24,32,40,48,64,96,128,256
	};
	unsigned char c = info[1];
	unsigned char fsci = c >> 4;
	if (fsci > 8) {
		fsci = 8;
	}
	return maxFrameSize[fsci];
}

static unsigned char Param_B_GetFormat(const unsigned char info[]) {
	unsigned char c = info[2];
	unsigned char fo = c & 0x3;
	unsigned char format = 0;

	if (fo & 1) { //CID
		format |= 2;
	}

	if (fo & 2) { //NAD
		format |= 1;
	}

	return format;
}

static int Param_B_Check(const unsigned char info[]) {
	unsigned char protocol_type = info[1] & 0x0F;

	if (protocol_type & (1 << 3)) {
		return 0;
	}
	return 1;
}

 int ISO14443p4b_GetParams(unsigned char* atqb, ISO14443p4Param_T* params) {

	 params->FWT = Param_B_GetFWT(atqb);
	 params->FGT = Param_B_GetFGT(atqb);
	 params->FSC = Param_B_GetFSC(atqb);
	 params->SFGT = Param_B_GetSFGT(atqb);
	 params->blockFormat = Param_B_GetFormat(atqb);
	 params->NAD = 0;
	 params->sn = 0;
	 return 0;
}
#endif
 